<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="PersonaCreateDlg" widgetVar="PersonaCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreatePersonaTitle}">

            <h:form id="PersonaCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{personaController.selected != null}">

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_nombre1}" for="nombre1" />
                        <p:inputText id="nombre1" value="#{personaController.selected.nombre1}" title="#{bundle.CreatePersonaTitle_nombre1}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_nombre1}"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_nombre2}" for="nombre2" />
                        <p:inputText id="nombre2" value="#{personaController.selected.nombre2}" title="#{bundle.CreatePersonaTitle_nombre2}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_apellido1}" for="apellido1" />
                        <p:inputText id="apellido1" value="#{personaController.selected.apellido1}" title="#{bundle.CreatePersonaTitle_apellido1}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_apellido1}"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_apellido2}" for="apellido2" />
                        <p:inputText id="apellido2" value="#{personaController.selected.apellido2}" title="#{bundle.CreatePersonaTitle_apellido2}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_fechaNacimiento}" for="fechaNacimiento" />
                        <p:calendar id="fechaNacimiento" pattern="MM/dd/yyyy" value="#{personaController.selected.fechaNacimiento}" title="#{bundle.EditPersonaTitle_fechaNacimiento}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_direccion1}" for="direccion1" />
                        <p:inputText id="direccion1" value="#{personaController.selected.direccion1}" title="#{bundle.CreatePersonaTitle_direccion1}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_direccion2}" for="direccion2" />
                        <p:inputText id="direccion2" value="#{personaController.selected.direccion2}" title="#{bundle.CreatePersonaTitle_direccion2}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_telefono}" for="telefono" />
                        <p:inputText id="telefono" value="#{personaController.selected.telefono}" title="#{bundle.CreatePersonaTitle_telefono}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_celular}" for="celular" />
                        <p:inputText id="celular" value="#{personaController.selected.celular}" title="#{bundle.CreatePersonaTitle_celular}" />

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_creationDate}" for="creationDate" />
                        <p:calendar id="creationDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{personaController.selected.creationDate}" title="#{bundle.EditPersonaTitle_creationDate}" required="true" requiredMessage="#{bundle.EditPersonaRequiredMessage_creationDate}" showOn="button"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_createdBy}" for="createdBy" />
                        <p:inputText id="createdBy" value="#{personaController.selected.createdBy}" title="#{bundle.CreatePersonaTitle_createdBy}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_createdBy}"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_lastUpdateDate}" for="lastUpdateDate" />
                        <p:calendar id="lastUpdateDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{personaController.selected.lastUpdateDate}" title="#{bundle.EditPersonaTitle_lastUpdateDate}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreatePersonaLabel_lastUpdateBy}" for="lastUpdateBy" />
                        <p:inputText id="lastUpdateBy" value="#{personaController.selected.lastUpdateBy}" title="#{bundle.CreatePersonaTitle_lastUpdateBy}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_lastUpdateBy}"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{personaController.saveNew}" value="#{bundle.Save}" update="display,:PersonaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PersonaCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="PersonaCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
